package com.tulingdemo.util;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class AsyncUtils2 {
    @Async("asyncExecutor")
    public void testMethod(Integer integer){
        log.info(Thread.currentThread().getName() + "asyncExecutor传入的参数为："+integer);
    }
    @Async("otherExecutor")
    public void testMethod2(Integer integer){
        log.info(Thread.currentThread().getName() + "otherExecutor传入的参数2为："+integer);
    }
    @Async
    public void simpleAsync(Integer integer){
        log.info("{}-Async线程执行xxx-{}", Thread.currentThread().getName(), integer);
    }
    public void simpleAsync2(Integer integer){
        log.info("{}-线程执行2-{}", Thread.currentThread().getName(), integer);
    }
}
